Villager POI Search Range Configs#217
Conversation
R00tB33rMan
left a comment
There was a problem hiding this comment.
Don’t see any breakages this’d ensue as-is and looks like all sites are covered!
|
I like the idea behind this, but I think this needs one change before merging. Right now the range configs only control whether the search range is 16 or 48. However, the behavior controllers always pass So if a user leaves:
they would probably expect vanilla-like behavior with a 48 block search range, but the chunk loading behavior is still changed. I think the chunk-loading change should either have its own config, or I am also not fully convinced that matching AcquirePoi’s range to ValidateNearbyPoi’s 16 block radius is logically equivalent. Acquisition and validation are different steps. A villager may need to discover a bed/workstation/bell farther than 16 blocks away, while validation later only checks nearby/known POIs. Could you split or adjust this so:
With that fixed, I think this would be much safer to merge. |
|
Oh yea that makes sense Ill get on that in a tiny bit |
|
Fixed up |
|
Looks good to me now, assuming this has been tested. |
AcquirePoi searches always run with a range of
48blocks. Villagers have 4 POI types that are run through 3 different behavior controllers in the mob brain, specifically searching forHOME,MEETING,JOB_SITE, andPOTENTIAL_JOB_SITE. Note thatJOB_SITEis the memory to validate andPOTENTIAL_JOB_SITEis the memory to acquire in their shared behavior controller. These POIs are later validated once present via theValidateNearbyPoiclass, which actually validates them in a radius of16blocks, unlike48which is what the initial search is for.With this in mind, there are 3 configs added that shrink the search radius from
48to16, to match the validator. These configs are as such:reduceJobSitePoiSearchRange- Reduces theJOB_SITE/POTENTIAL_JOB_SITEPOI search rangereduceHomePoiSearchRange- Reduces theHOMEPOI search rangereduceMeetingPointPoiSearchRange- Reduces theMEETING_POINTPOI search rangeNote that these configs are in kebab-case for the actual YAML config
This PR also disables these 3 behavior controllers from loading POI chunks if the chunk isn't currently loaded. There were some noticeable MSPT improvements, being roughly
18.21ms->13.57msof Villager ticking(inactive tick included), in a single region with ~585 villagers. While not the most impactful optimization, this does help optimize the current heaviest behavior controllers for Villagers in Canvas, which is at least something.Note that these options do cause slight deviation from Vanilla, however probably not entirely noticeable to the average player.